package cn.edu.scau.cmi.ZengLinghong.chapter10;

import java.io.*;

public class Example10_10 {
	public static void main(String[] args) {
		try {
			ByteArrayOutputStream outbyte = new ByteArrayOutputStream();
			byte[] byteContent = "60".getBytes();
			outbyte.write(byteContent);

			ByteArrayInputStream inByte = new ByteArrayInputStream(outbyte.toByteArray());
			byte backByte[] = new byte[outbyte.toByteArray().length];
			inByte.read(backByte);
			System.out.println(new String(backByte));

			CharArrayWriter outchar = new CharArrayWriter();
			char[] charContent = "ڿ".toCharArray();
			outchar.write(charContent);
			CharArrayReader inChar = new CharArrayReader(outchar.toCharArray());
			char backChar[] = new char[outchar.toCharArray().length];
			inChar.read(backChar);

			System.out.println(new String(backChar));
		} catch (IOException exp) {

		}
	}
}
